<template>
  <div>
    <a-form-item label="Panel框">
      <a-switch v-model:checked="dataC.options.panel" />
    </a-form-item>
    <a-form-item label="panel标题" class="mb-1" v-show="dataC.options.panel">
      <a-input
        style="width: 200px"
        v-model:value="dataC.options.panelTitle"
        placeholder="请输入"
      ></a-input>
    </a-form-item>
    <a-form-item
      label="panel左右边距"
      class="mb-1"
      v-show="dataC.options.panel"
    >
      <a-input-number
        style="width: 200px"
        v-model:value="dataC.options.panelPadding"
        placeholder="请输入数字"
      ></a-input-number>
    </a-form-item>
  </div>
</template>

<script>
  import { CheckCircleOutlined } from '@ant-design/icons-vue'
  import { Getsqlvalues } from '@/api/flow/api'
  export default {
    components: {
      CheckCircleOutlined,
    },
    props: {
      data: {
        type: Object,
        default: Object,
      },
      formData: {
        type: Object,
        default: Object,
      },
    },
    data() {
      return {
        dataC: this.data,
        height: JSON.parse(JSON.stringify(this.data.options.height)),
        maxWidth:
          this.data.options.maxWidth === undefined
            ? undefined
            : JSON.parse(JSON.stringify(this.data.options.maxWidth)),
      }
    },

    methods: {
      blur() {
        this.dataC.options.height = this.height
      },
      selectSQL() {
        var that = this
        Getsqlvalues({
          DbId: 'ce91cc3e-58fb-200d-51fc-39fa7895033f',
          Sql: that.dataC.options.sql,
        }).then((res) => {
          if (res.isSuccess) {
            console.log(res.content)
            this.$message.success('sql语句正确')
          } else {
            this.$message.error(res.message)
          }
        })
      },
    },
  }
</script>
